package com.test.demo.service.impl;

import com.test.demo.mapper.UserMapper;
import com.test.demo.po.User;
import com.test.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService{
    @Autowired
    UserMapper userMapper; //spring框架配置了注解，自动注入

    @Override
    public int insertUser(User user) throws Exception {
        // TODO Auto-generated method stub

        return userMapper.insert(user);
    }

    @Override
    public User selectUserByAccountName(String accountName) throws Exception {
        return userMapper.selectByAccountName(accountName);
    }

}
